<%-- 
    Document   : Registration
    Created on : Nov 21, 2012, 10:45:59 AM
    Author     : vupttse
--%>

<%@page import="ass.data.UserDAL"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="css/modern.css" rel="stylesheet">
        <link href="css/modern-responsive.css" rel="stylesheet">
        <link href="css/site.css" rel="stylesheet" type="text/css">

        <script src="js/jquery-1.8.2.min.js"></script>
        <script src="js/google-analytics.js"></script>
        <script src="js/github.info.js"></script>
        <script src="js/sharrre/jquery.sharrre-1.3.4.min.js"></script>
        <script src="js/carousel.js"></script>
        <script src="js/dropdown.js"></script>
        <script src="js/slider.js"></script>
        <script src="js/hover.js"></script>
        <title>Registration</title>
    </head>
    <body>
        <%
            try {
                String username = request.getParameter("username");
                String password = request.getParameter("password");
                String gender = request.getParameter("gender");
                String tel = request.getParameter("tel");
                String address = request.getParameter("address");
                String fullName = request.getParameter("fullName");
                String nationality = request.getParameter("nationality");
                if (username != null && password != null) {
                    UserDAL.insert(username, password, gender, "Customer", fullName, tel, address, "0", nationality);
                    response.sendRedirect("LoginPage.jsp");
                }
            } catch (Exception e) {
                out.println("Error: " + e.getMessage());
            }

        %>
        <div class="page">
            <jsp:include page="Navigation.jsp"></jsp:include>
                <div class="page-region">
                    <div class="page-region-content">
                        <div class="grid">
                            <div class="row">
                                <div class="span6 bg-color-white fg-color-pink border-color-purple" style="padding-left: 10px">
                                    <h2 class="fg-color-pink">Registration</h2>
                                    <p>Please fill in all required information below to join us!</p>
                                    <form action="" method="post">
                                        <table class="hovered">
                                            <tr>
                                                <td>UserName</td>
                                                <td><input type="text" name="username"></td>
                                            </tr>
                                            <tr>
                                                <td>Password</td>
                                                <td><input type="password" name="password"></td>
                                            </tr>
                                            <tr>
                                                <td>Gender</td>
                                                <td>
                                                    <input type="radio" name="gender" value="Male">Male
                                                    <input type="radio" name="gender" value="Female">Female
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Full Name</td>
                                                <td><input type="text" name="fullName"></td>
                                            </tr>
                                            <tr>
                                                <td>Telephone Number</td>
                                                <td><input type="text" name="tel"></td>
                                            </tr>
                                            <tr>
                                                <td>Address</td>
                                                <td><input type="text" name="address"></td>
                                            </tr>
                                            <tr>
                                                <td>Nationality</td>
                                                <td><input type="text" name="nationality"></td>
                                            </tr>
                                            <tr>
                                                <td></td><td><input type="submit" value="Register">
                                                    <input type="reset" value="Clear"></td>
                                            </tr>
                                        </table>
                                    </form>
                                </div>
                                <div class="span5">
                                    <ul class="replies">
                                        <li class="bg-color-blue">
                                            <b class="sticker sticker-right sticker-color-blue"></b>
                                            <div class="avatar"><img src="images/logo.gif"/></div>
                                            <div class="reply">
                                                <div class="date">21.11.2012</div>
                                                <div class="author">VuPTT</div>
                                                <div class="text">"Come and get the latest models! Discount 20% for 2
                                                    <i class="icon-star"></i> customers!"
                                                </div>
                                            </div>
                                        </li>
                                    </ul>

                                    <div class="notices">
                                        <div class="bg-color-yellow">
                                            <a href="UnderConstruction.jsp" class="close"></a>
                                            <div class="notice-icon"> <i class="icon-gift-2"></i> </div>
                                            <div class="notice-image">  <i class="icon-gift-2 big"></i> </div>
                                            <div class="notice-header"> Free-gifts for Christmas! </div>
                                            <div class="notice-text"> Fifty gifts are waiting for the earliest customers! </div>
                                        </div>
                                    </div>
                                    <div class="notices">
                                        <div class="bg-color-green">
                                            <a href="UnderConstruction.jsp" class="close"></a>
                                            <div class="notice-icon"> <i class="icon-gift-2"></i> </div>
                                            <div class="notice-image">  <i class="icon-gift-2 big"></i> </div>
                                            <div class="notice-header"> Free-gifts for Christmas! </div>
                                            <div class="notice-text"> Fifty gifts are waiting for the earliest customers! </div>
                                        </div>
                                    </div>
                                    <div class="notices">
                                        <div class="bg-color-purple">
                                            <a href="UnderConstruction.jsp" class="close"></a>
                                            <div class="notice-icon"> <i class="icon-gift-2"></i> </div>
                                            <div class="notice-image">  <i class="icon-gift-2 big"></i> </div>
                                            <div class="notice-header"> Free-gifts for Christmas! </div>
                                            <div class="notice-text"> Fifty gifts are waiting for the earliest customers! </div>
                                        </div>
                                    </div>
                                </div>          
                            </div>
                        </div>
                    </div>
                </div>
            <%@include file="footer.html" %>
        </div>
    </body>
</html>
